package com.voodoo.lib_crashexception.model;

import java.io.Serializable;

public class CrashModel implements Serializable {

    // 崩溃主体信息
    private Throwable ex;
    // 崩溃主信息
    private String exceptionMsg;
    // 中文名称
    private String errorChineseName;
    // 崩溃类名
    private String className;
    // 崩溃文件名
    private String fileName;
    // 崩溃方法
    private String methodName;
    // 崩溃行数
    private int lineNumber;
    // 崩溃类型
    private String exceptionType;
    // 全部信息
    private String fullException;
    // 崩溃时间
    private long time;
    // 设备信息
    private Device device = new Device();

    public Throwable getEx() {
        return ex;
    }

    public void setEx(Throwable ex) {
        this.ex = ex;
    }

    public String getExceptionMsg() {
        return exceptionMsg;
    }

    public void setExceptionMsg(String exceptionMsg) {
        this.exceptionMsg = exceptionMsg;
    }

    public String getErrorChineseName() {
        return errorChineseName;
    }

    public void setErrorChineseName(String errorChineseName) {
        this.errorChineseName = errorChineseName;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public int getLineNumber() {
        return lineNumber;
    }

    public void setLineNumber(int lineNumber) {
        this.lineNumber = lineNumber;
    }

    public String getExceptionType() {
        return exceptionType;
    }

    public void setExceptionType(String exceptionType) {
        this.exceptionType = exceptionType;
    }

    public String getFullException() {
        return fullException;
    }

    public void setFullException(String fullException) {
        this.fullException = fullException;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public Device getDevice() {
        return device;
    }

    public void setDevice(Device device) {
        this.device = device;
    }

    @Override
    public String toString() {
        return String.format("崩溃主体信息 = %s\n异常翻译 = %s\n崩溃主信息 = %s\n崩溃类名 = %s\n崩溃文件名 = %s\n崩溃方法 = %s\n崩溃行数 = %s\n崩溃类型 = %s\n崩溃时间 = %s\n全部信息 = %s\n \n设备信息\n%s"
                , ex, errorChineseName, exceptionMsg, className, fileName, methodName
                , lineNumber, exceptionType, time, fullException, device
        );
    }
}
